package com.xrc;

import java.util.Scanner;

import static java.time.Year.isLeap;

public class Exercise03 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入年份和月份:");
        int year=sc.nextInt();
        int month=sc.nextInt();
        int days=0;
        if((year%4==0&&year/100!=0)||(year%400==0)){

            switch (month){
                case 1:
                case 3:
                case 5:
                case 7:
                case 8:
                case 10:
                case 12:
                    days=31;
                    break;
                case 4:
                case 6:
                case 9:
                case 11:
                    days=30;
                case 2:
                    days=isLeap(year) ? 29:28;

            }
        }System.out.println(days);
        /*else {
            switch (month){
                case 1:
                case 3:
                case 5:
                case 7:
                case 8:
                case 10:
                case 12:
                    System.out.println("共有：31天");
                case 4:
                case 6:
                case 9:
                case 11:
                    System.out.println("该月有30天");
                case 2:
                    System.out.println("该月有28天");
            }
        }*/
    }
}
